/**
 * Created by meiyun1 on 2017/8/11.
 */
import Vue from 'vue'
import params from '../conf/params'
import { clearEmptyValue } from '../utils/common'
export default {
  getBannerList (search) {
    clearEmptyValue(search)
    return Vue.http.get(`${params.base_url}/banners`, {params: search})
  },
  addBanner (banner) {
    return Vue.http.post(`${params.base_url}/banner`, banner)
  },
  updateBanner (id, banner) {
    return Vue.http.put(`${params.base_url}/banner/${id}`, banner)
  },
  getBannerById (id) {
    return Vue.http.get(`${params.base_url}/banner/${id}`)
  },
  deleteBanner (ids) {
    return Vue.http.delete(`${params.base_url}/banner/${ids}`)
  }
}
